package com.youlai.boot.system.model.entity;

import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.youlai.boot.common.listener.CreatedByListenerFlag;
import com.youlai.boot.common.listener.UpdatedByListenerFlag;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 用户实体
 */
@Getter
@Setter
@Accessors(chain = true)
@Table(value = "sys_user")
public class SysUserEntity implements CreatedByListenerFlag, UpdatedByListenerFlag {
    /**
     *  主键ID
     */
    @Id(keyType = KeyType.Auto)
    private Long id;

    /**
     * 用户名
     */
    @Column(value = "username")
    private String username;

    /**
     * 昵称
     */
    @Column(value = "nickname")
    private String nickname;

    /**
     * 性别((1-男 2-女 0-保密)
     */
    @Column(value = "gender")
    private Integer gender;

    /**
     * 密码
     */
    @Column(value = "password")
    private String password;

    /**
     * 部门ID
     */
    @Column(value = "dept_id")
    private Long deptId;

    /**
     * 用户头像
     */
    @Column(value = "avatar")
    private String avatar;

    /**
     * 联系方式
     */
    @Column(value = "mobile")
    private String mobile;

    /**
     * 状态((1-正常 0-禁用)
     */
    @Column(value = "status")
    private Integer status;

    /**
     * 用户邮箱
     */
    @Column(value = "email")
    private String email;

    /**
     * 微信 OpenID
     */
    @Column(value = "openid")
    private String openid;

    /**
     * 创建人ID
     */
    @Column(value = "create_by")
    private Long createBy;

    /**
     * 更新人ID
     */
    @Column(value = "update_by")
    private Long updateBy;

    /**
     * 逻辑删除
     */
    @Column(value = "is_deleted", isLogicDelete = true)
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @Column(value = "create_time", onInsertValue = "now()")
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(value = "update_time", onInsertValue = "now()", onUpdateValue = "now()")
    private Date updateTime;
}